package com.etc.entity;

import org.springframework.stereotype.Component;

import java.util.Objects;

/**
 * (Chat)实体类
 *
 * @author makejava
 * @since 2021-10-18 22:32:00
 */
@Component
public class Chat  {
    private static final long serialVersionUID = 415427065659206460L;
    /**
     * 弹幕
     */
    private String chatId;
    /**
     * 用户
     */
    private User userId;
    /**
     * 弹幕内容
     */
    private String chatContent;
    /**
     * 弹幕时间
     */
    private String chatDate;


    public String getChatId() {
        return chatId;
    }

    public void setChatId(String chatId) {
        this.chatId = chatId;
    }

    public User getUserId() {
        return userId;
    }

    public void setUserId(User userId) {
        this.userId = userId;
    }

    public String getChatContent() {
        return chatContent;
    }

    public void setChatContent(String chatContent) {
        this.chatContent = chatContent;
    }

    public String getChatDate() {
        return chatDate;
    }

    public void setChatDate(String chatDate) {
        this.chatDate = chatDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Chat chat = (Chat) o;
        return Objects.equals(chatId, chat.chatId) &&
                Objects.equals(userId, chat.userId) &&
                Objects.equals(chatContent, chat.chatContent) &&
                Objects.equals(chatDate, chat.chatDate);
    }

    @Override
    public int hashCode() {
        return Objects.hash(chatId, userId, chatContent, chatDate);
    }

    @Override
    public String toString() {
        return "Chat{" +
                "chatId='" + chatId + '\'' +
                ", userId=" + userId +
                ", chatContent='" + chatContent + '\'' +
                ", chatDate='" + chatDate + '\'' +
                '}';
    }

    public Chat() {
    }

    public Chat(String chatId, User userId, String chatContent, String chatDate) {
        this.chatId = chatId;
        this.userId = userId;
        this.chatContent = chatContent;
        this.chatDate = chatDate;
    }
}

